package com.woniuxy.Test;

import com.woniuxy.Service.ClazzService;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

/**
 * @Author：向天浩
 * @Date：2022/1/21 11:57
 * @Description :TODO
 */
//基于xml配置文件的事务实现
public class XmlTest {
    public static void main(String[] args) {
    ApplicationContext applicationContext=new ClassPathXmlApplicationContext("applicationContext.xml");
        ClazzService clazzServiceImp = applicationContext.getBean("clazzServiceImp", ClazzService.class);
        //如果执行失败或者出异常就会进行事务回滚，对数据库的操作不会生效
        clazzServiceImp.updateClazzById(1001,"88期");






    }
}

